<template>

  <div style="margin-top: 40px">
    <!-- main -->
    <div class="main">
      <div class="main-container" style="margin-left: 0px">
        <div class="container">
          <div class="location clearfix">
            <router-link :to="{ name: 'indexList'}">首页</router-link>
            <router-link :to="{ name: 'newsList'}">新闻消息</router-link>
            <a href="javascript:;">新闻详情</a>
          </div>

          <div class="article-container">
            <div class="article-header">
              <div class="title">{{ newsData.title }}</div>
              <div class="tags">
                <div class="item">{{ newsData.newsType_dictText }} &nbsp;&nbsp;&nbsp;&nbsp; {{ newsData.createTime }}</div>
              </div>
            </div>
            <div class="article-content clearfix"  v-html="newsData.text">

            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- main end -->
  </div>

</template>

<script>

import { fetchDetail } from '@/api/tnews/tnews'
import EmptyView from '@/components/EmptyView/index'


export default {
  components: {  EmptyView },
  data() {
    return {
      newsData: {},
    }
  },

  created() {
    // 文档ID
    const id = this.$route.params.newsId
    this.fetchData(id)
  },
  methods: {

    fetchData(newsId) {
      fetchDetail(newsId).then(res => {
        this.newsData = res.data
      })
    }
  }
}
</script>

